/*
 * Copyright (c) 2025 Huawei Technologies Co., Ltd.
 * openUBMC is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *         http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */

#ifndef DEVMON_ROOT_OBJECT_H
#define DEVMON_ROOT_OBJECT_H

#include <mc/engine.h>

#include "root_interface.h"

namespace devmon {

class root_object;
using root_object_ptr = mc::shared_ptr<root_object>;

class root_object : public mc::engine::object<root_object> {
public:
    MC_OBJECT(root_object, "Devmon", "/bmc/topology", (root_interface))

    root_object() = default;

    static root_object_ptr create_root_object(mc::engine::service* service) {
        auto root_object_ptr = mc::make_shared<root_object>();
        root_object_ptr->set_object_name("Devmon");

        service->register_object(root_object_ptr);
        ilog("root object created");
        return root_object_ptr;
    }

private:
    root_interface m_root_interface;
};

} // namespace devmon

#endif // DEVMON_ROOT_OBJECT_H